#define _CRT_SECURE_NO_WARNINGS
#include"string.h"

namespace my_string
{
	void test1()
	{
		string s1;
		string s2 = "hello";
		cout << s1.c_str() << endl;
		cout << s2.c_str() << endl;


		string s3 = s2;
		s1 = s2;
		cout << s3.c_str() << endl;
		cout << s2.c_str() << endl;

	}

	void test2()
	{
		string s1 = "hello world";
	
		for (auto i : s1)
		{
			cout << i << " ";
		}
		cout << endl;

		string s2 = "ni hao";
		string::iterator it = s2.begin();
		while (it != s2.end())
		{
			cout << *it << " ";
			++it;
		}
		cout << endl;
	}
}

int main()
{
	my_string::test1();
	return 0;
}